import pymongo

#无需权限认证
#myclient = pymongo.MongoClient("mongodb://localhost:27017/")
myclient = pymongo.MongoClient('localhost',27017)
mydb = myclient["runoobdb"]
mycol = mydb["sites"]
print(myclient.list_database_names())